package com.zgf.easy.proxy.demo.impla.order;

import com.zgf.easy.proxy.anno.AutoService;
import com.zgf.easy.proxy.demo.extend.order.OrderExtendApi;
import com.zgf.easy.proxy.demo.extend.order.mode.OrderReq;
import com.zgf.easy.proxy.demo.extend.order.mode.OrderRes;
import com.zgf.easy.proxy.demo.impla.bean.TestaBeanService;
import com.zgf.easy.proxy.handler.BaseHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@AutoService(value ="orderExtendApiImplA")
public class OrderExtendApiImpl extends BaseHandler implements OrderExtendApi {

    @Autowired
    private TestaBeanService testaBeanService;

    /**
     * 第一次调用前初始化
     */
    @Override
    public void init() {
    }

    @Override
    public OrderRes getOrder(OrderReq req) {
        OrderRes res = new OrderRes();
        res.setName(req.getName());
        log.info("impla-OrderExtendApiImpl.getOrder={}", res);
        testaBeanService.test();
        return res;
    }

}
